package game.gui.buttons;

import game.MainGame.WorldMemoryGame;
import game.jabberclient.Question;

import java.awt.Color;

import javax.swing.JOptionPane;

public class WorldLbl extends FirstLbl {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	public WorldLbl(int i, WorldMemoryGame w) {
		super(i, w);
		color = new Color(205, 50, 120);
		this.setBackground(color);
	}

	public boolean popQuestion(WorldMemoryGame w) {
		Object[] options = { "Art", "Geography", "History", "Science", "Sport",
				"Varia" };
		int n = JOptionPane.showOptionDialog(w,
				"You can choose any category you like!", "World question",
				JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
				null, options, options[0]);
		System.out.println(n);
		Question question = null;
		switch (n) {
		case 0:
			question = new Question("Art");
			category = "ArtLbl";
			break;
		case 1:
			question = new Question("Geography");
			category = "GeographyLbl";
			break;
		case 2:
			question = new Question("History");
			category = "HistoryLbl";
			break;
		case 3:
			question = new Question("Science");
			category = "ScienceLbl";
			break;
		case 4:
			question = new Question("Sport");
			category = "SportLbl";
			break;
		case 5:
			question = new Question("Varia");
			category = "VariaLbl";
			break;
		}
		Object[] options1 = question.getOptions();
		String question1 = question.getQuestion();
		rightAnswer = question.getRightAnswer();
		int n1 = JOptionPane.showOptionDialog(w, question1, "World Question",
				JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
				null, options1, null);
		if(n1 == rightAnswer){
			return true;
		}
		return false;
	}
}
